#ifndef ACBUILDER_H
#define ACBUILDER_H

#include <stdint.h>

typedef struct{
    uint16_t pkgLength;
    uint8_t  pkgId;
    uint8_t  attachCode;
    uint8_t  funCode;
    uint8_t*  payloadData;
    uint16_t payloadSize;
}ACPackage;


class ACBuilder
{
private:
    ACBuilder();

public:
    static ACBuilder* getInstance();

    void buildPackage(uint8_t pkgId, uint8_t attachCode, uint8_t funCode, uint8_t* data = NULL, uint16_t size = 0);
    void buildPackage(ACPackage& pkg);
    void buildPackage();

    uint16_t dumpPackage(uint8_t* buf);


private:
    static ACBuilder   mInstance;
    ACPackage          mPackage;
    uint8_t            mPackageBytes[265];
};

#endif // ACBUILDER_H
